import request from '@/utils/request'

export function getDiseaseTypeListApi(query) {
	return request({
		url: '/xcjk/kg-disease-type/page',
		method: "get",
		params: query,
	})
}

export function getDiseaseListApi(query) {
	return request({
		url: '/system/dict-data/page',
		method: "get",
		params: query,
	})
}

export function getCaseManageApi(query) {
	return request({
		url: '/xcjk/case-manage/page',
		method: "get",
		params: query,
	})
}

export function getMyProcessInstancePage(query) {
	return request({
		url: '/bpm/process-instance/my-page',
		method: 'get',
		params: query
	})
}
export function getTodoTaskPage(query) {
	return request({
		url: '/bpm/task/todo-page',
		method: 'get',
		params: query
	})
}


export function getDoneTaskPage(query) {
	return request({
		url: '/bpm/task/done-page',
		method: 'get',
		params: query
	})
}

//审批详情相关接口

// 创建日常养护任务
export function createDmTask(data) {
	return request({
		url: "/xcjk/dm-task/create",
		method: "post",
		data: data,
	});
}
// 获得日常养护任务分页
export function getDmTaskPage(query) {
	return request({
		url: "/xcjk/dm-task/page",
		method: "get",
		params: query,
	});
}
// 获得案卷
export function getCaseManage(id) {
	return request({
		url: "/xcjk/case-manage/get?id=" + id,
		method: "get",
	});
}
export function getProcessDefinitionBpmnXML(id) {
	return request({
		url: '/bpm/process-definition/get-bpmn-xml?id=' + id,
		method: 'get'
	})
}
// 获得日常养护项目管理分页
export function getDmProjectManagePage(query) {
	return request({
		url: '/xcjk/dm-project-manage/page',
		method: 'get',
		params: query
	})
}
export function getProcessInstance(id) {
	return request({
		url: '/bpm/process-instance/get?id=' + id,
		method: 'get',
	})
}
export function approveTask(data) {
	return request({
		url: '/bpm/task/approve',
		method: 'PUT',
		data: data
	})
}
export function setExpect(data) {
	return request({
		url: `/xcjk/case-manage/expect?caseId=${data.caseId}&expectDate=${data.expectDate}`,
		method: "post",
		data: data,
	});
}
export function getTaskListByProcessInstanceId(processInstanceId) {
	return request({
		url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId,
		method: 'get',
	})
}
export function rejectTask(data) {
	return request({
		url: '/bpm/task/reject',
		method: 'PUT',
		data: data
	})
}
export function updateTaskAssignee(data) {
	return request({
		url: '/bpm/task/update-assignee',
		method: 'PUT',
		data: data
	})
}
export function queryExpect(data) {
	return request({
		url: `/xcjk/case-manage/queryExpect?caseId=${data}`,
		method: "get",
		data: data,
	});
}
// 获取用户精简信息列表
export function listSimpleUsers() {
	return request({
		url: "/system/user/list-all-simple",
		method: "get",
	});
}
export function getActivityList(query) {
	return request({
		url: '/bpm/activity/list',
		method: 'get',
		params: query
	})
}

// 批量更新状态
export function batchUpdateStatus(data) {
	return request({
		url: "/xcjk/case-manage/batchUpdateStatus",
		method: "put",
		data: data,
	});
}